Skip to content

Conversation

@chambridge
Copy link
Collaborator

@chambridge chambridge commented Jan 14, 2026

Description

Refactored FileSizeLimitsAssessor to use git ls-files instead of glob() to enumerate source files. This ensures that files in .gitignore'd directories (like .venv/, node_modules/) are not scanned, which was causing false failures when large vendored files exceeded the line count thresholds.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactoring (no functional changes)
  • Performance improvement
  • Test coverage improvement

Related Issues

Fixes #245

Changes Made

  • Refactored FileSizeLimitsAssessor.assess() to use git ls-files instead of pathlib.glob() for file discovery, ensuring .gitignore rules are respected
  • Added graceful fallback to rglob() for non-git repositories
  • Added safe_subprocess_run import from subprocess_utils for secure subprocess execution with timeout
  • Added 5 new unit tests for FileSizeLimitsAssessor covering gitignore behavior, edge cases, and scoring logic

Testing

  • Unit tests pass (pytest)
  • Integration tests pass
  • Manual testing performed
  • No new warnings or errors

Checklist

  • My code follows the project's code style
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published

Screenshots (if applicable)

Additional Notes

Refactored FileSizeLimitsAssessor to use `git ls-files` instead of
`glob()` to enumerate source files. This ensures that files in
.gitignore'd directories (like .venv/, node_modules/) are not scanned,
which was causing false failures when large vendored files exceeded
the line count thresholds.

Fixes ambient-code#245

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: Chris Hambridge <chambrid@redhat.com>
@chambridge chambridge force-pushed the fix/245-file-size-assessor-respects-gitignore branch from 341bef8 to 12a70ab Compare January 14, 2026 21:53
@jeremyeder
Copy link
Contributor

this is one where people are going to need to develop a custom config or we can debate how many lines are too many for a file. :-)

@jeremyeder jeremyeder merged commit eaaecc2 into ambient-code:main Jan 15, 2026
10 checks passed
@github-actions
Copy link
Contributor

Hi @jeremyeder! Thanks for your interest in AgentReady.

The /agentready assess command is currently restricted to repository maintainers.

To assess your own repository:

pip install agentready
agentready assess .

See AgentReady documentation for more information.

github-actions bot pushed a commit that referenced this pull request Jan 15, 2026
## [2.22.1](v2.22.0...v2.22.1) (2026-01-15)

### Bug Fixes

* **assessors:** FileSizeLimitsAssessor now respects .gitignore ([#248](#248)) ([eaaecc2](eaaecc2)), closes [#245](#245)
@github-actions
Copy link
Contributor

🎉 This PR is included in version 2.22.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] file_size_limits includes .venv files despite .gitignore

2 participants